/*
 * @Author: huangyq
 * @Date: 2022-04-20 17:03:53
 * @LastEditTime: 2022-06-14 14:14:19
 * @LastEditors: huangyq
 * @Description: 用户相关接口
 * @FilePath: /vue3-boilerplate-pc-client/src/apis/portal/RoleApi.ts
 */
import { IBaseRequest, IBaseResponse, AxiosPromise } from '@/plugins/httpHelper'
import PortalApi from './PortalApi'

export default class RoleApi extends PortalApi {
  static path = super.$basePath + '/role'
  /**
   * @summary 权限
   */
  static permissionUsingGet = (
    params: IBaseRequest
  ): AxiosPromise<IBaseResponse> => {
    // return super.baseGetRequest(this.path + '/permission', params)
    return Promise.resolve({
      data: {
        success: true,
        permissions: ['000'],
        params
      }
    }) as AxiosPromise
  }

  /**
   * @summary 用户信息
   */
  static queryLoginUserUsingGET = (
    params: IBaseRequest
  ): AxiosPromise<IBaseResponse> => {
    return super.baseGetRequest(this.path + '/login-user', params)
  }

  /**
   * @summary 角色列表
   */
  static roleListUsingGet = (
    params: IBaseRequest
  ): AxiosPromise<IBaseResponse> => {
    // return super.baseGetRequest(this.path + '/page', params)
    return Promise.resolve({
      data: {
        success: true,
        data: [
          { name: '角色1', id: 1 },
          { name: '角色2', id: 2 },
          { name: '角色3', id: 3 },
          { name: '角色4', id: 4 }
        ],
        params
      }
    }) as AxiosPromise
  }
}
